import 'dart:typed_data';

import 'package:usbflutter/usb/handler/IDevicceHandler.dart';

class UsbPackage {
  static const NEW_DATA = 1;
  static const DISCONNECT = 2;
  static const USB_PERMISSION = 3;

  int event = NEW_DATA;

  int deviceId = 0;

  int permission = 1;

  Uint8List? data;

  IDeviceHandler? handler;

  UsbPackage.parse(map) {
    data = map['data'];
    deviceId = map['deviceId'] ?? -1;
    permission = map['permission'] ?? 1;
  }
}
